#ifndef INC_UNKNOWNCOMMAND_H
#define INC_UNKNOWNCOMMAND_H

#include "command.h"
using Commands::Command;
using Commands::CommandCreator;
using Commands::NotImplemented;

#include <Poco/Net/SocketAddress.h>
using Poco::Net::SocketAddress;

#include <Poco/DOM/Document.h>
using Poco::XML::Document;

namespace Commands{
	class UnknownCommand:public Command{
		public:
			UnknownCommand(string repr, SocketAddress addr, SocketAddress dest);
			~UnknownCommand();
			
			/**
			 * Tries to execute the command. Will result in NotImplemented exception.
			 */
			void execute();

			/**
			 * Returns the name by which the command is registered with a CommandFactory
			 * @return commandname
			 */
			string name();
			
			/**
			 * Undoes this command, if implemented. If not implemented, throws an NotImplemented excpetion.
			 */	
			void undo();
			
			/**
			 * Return a string with which this command can be remade if it were fed into a CommandFactory
			 * @return representational string
			 */
			string repr();
			
			/**
			 * Return the creator to make this command given the representational string
			 * @return a CommandCreator for this Command
			 */
			CommandCreator creator();

			/**
			 * Returns the original command representation
			 * @return original representation string
			 */
			string originalCommandRepr();

			SocketAddress originator();
			SocketAddress destination();

			bool isUnknown(){
				return true;
			}
		
		private:
			static Command* makeCommand(string r, void* s);
			static const string NAME;

			const string _repr;
			const SocketAddress _addr;
			const SocketAddress _dest;
	};
}

#endif
